//------------------------------------------------------------------------------
// PasCassa - a Delphi/Pascal class library for Apache Cassandra
//
// Copyright (c) 2010-2013 Jens Geyer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//------------------------------------------------------------------------------
unit DataModel.Entity.TestData;

interface

uses
  Classes, Windows, SysUtils, Math, Generics.Collections,
  Cassandra_200,
  Cassandra.Client,
  ReadWrite.Constants,
  Thrift.Collections;

type
  //--- column families ---------------------------------

  ITestDataFamily = interface( PasCassa.IColumnFamily)
    ['{A78450BA-1894-4F04-B4C6-AC4EB8DE21A6}']
  end;


  TTestDataFamily = class( PasCassa.TColumnFamily, ITestDataFamily)
  strict protected
    function  Define : ICfDef;  override;
    function  GetColumnEnumerator( const pEntity : PasCassa.IDataEntity) : PasCassa.IColumnDataEnumerator;  override;
  end;


implementation


//--- TTestDataFamily --------------------------------------------


function TTestDataFamily.Define : ICfDef;
//var coldef : IColumnDef;
begin
  result := TCfDefImpl.Create;
  result.Name                     := Self.FName;
  result.Comparator_type          := PasCassa.TYPE_UTF8;
  result.Key_validation_class     := PasCassa.TYPE_UTF8;
  result.Default_validation_class := PasCassa.TYPE_UTF8;
  result.comment                  := 'TestData column family (UTF8)';

  {
  // index
  result.Column_metadata  := TThriftListImpl<IColumnDef>.Create;
  // index on empl
  coldef                  := TColumnDefImpl.Create;
  coldef.Name             := SysUtils.TEncoding.UTF8.GetBytes( COL_DATE);
  coldef.Validation_class := 'UTF8Type';
  coldef.Index_type       := TIndexType.KEYS;
  coldef.Index_name       := COL_DATE;
  result.Column_metadata.Add( coldef);
  }
end;


function TTestDataFamily.GetColumnEnumerator( const pEntity : PasCassa.IDataEntity) : PasCassa.IColumnDataEnumerator;
begin
  ASSERT(FALSE);
  result := nil;
end;



end.

